<?php

namespace app\company\validate;


class DeliverCarValidate extends BaseValidate
{
    public function __construct()
    {
        $rule = [
            "no"   => "require|unique:deliver_car|max:20",
            "type" => "require|in:1,2,3,4,5,6,7,8",
        ];

        $message = [
            "no.require"   => "车牌号不能为空",
            "no.unique"    => "车牌号已存在",
            "no.max"       => "车牌号长度不能超过20",
            "type.require" => "车辆类型不能为空",
            "type.in"      => "车辆类型不正确",
        ];

        $scene = [
            "add" => ["no", "type"],
        ];
        parent::__construct($rule, $message, $scene);
    }
}